﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="InformationSystem.WebSite._Default" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>学生事务服务系统</title>
    <link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
    <link rel="Stylesheet" type="text/css" href="css/jquery-ui-1.7.1.custom.css" />
    <!--[if IE 7]><link rel="stylesheet" href="css/ie.css" type="text/css" media="screen, projection" /><![endif]-->
    <!--[if IE 6]><link rel="stylesheet" href="css/ie6.css" type="text/css" media="screen, projection" /><![endif]-->
    <link rel="stylesheet" type="text/css" href="css/markitup/style.css" />
    <link rel="stylesheet" type="text/css" href="css/markitup/default/style.css" />
    <link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen" />
    <!--[if IE]>
		<style type="text/css">
		  .clearfix {
		    zoom: 1;     /* triggers hasLayout */
		    display: block;     /* resets display for IE/Win */
		    }  /* Only IE can see inside the conditional comment
		    and read this CSS rule. Don't ever use a normal HTML
		    comment inside the CC or it will close prematurely. */
		</style>
	<![endif]-->
    <!-- JavaScript -->
    <script type="text/javascript" src="Scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="Scripts/jquery-ui-1.7.1.custom.min.js"></script>
    <script type="text/javascript" src="Scripts/hoverIntent.js"></script>
    <script type="text/javascript" src="Scripts/superfish.js"></script>
    <script type="text/javascript">
        // initialise plugins
        jQuery(function () {
            jQuery('ul.sf-menu').superfish();
        });

        function resetContent() {
            mywindow.clearContent();
        }
    </script>
    <script type="text/javascript" src="Scripts/excanvas.pack.js"></script>
    <script type="text/javascript" src="Scripts/jquery.flot.pack.js"></script>
    <script type="text/javascript" src="Scripts/jquery.markitup.pack.js"></script>
    <script type="text/javascript" src="Scripts/set.js"></script>
    <script type="text/javascript" src="Scripts/custom.js"></script>
    <!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.pack.js"></script><![endif]-->
    <script type="text/javascript">
        var renderAfficheTopic = function (value, p, record) {
            return String.format('<a style="color:{0}" onclick="changeColor(this)" href="Module/NoticeMgr/getmessage.aspx?m=affiche&id={1}" target="_blank">{2}</a>', record.data.hasread ? "#800080" : "Black", record.data.afficheID, value);
        }
        var renderWorkInfoTopic = function (value, p, record) {
            return String.format('<a style="color:{0}" onclick="changeColor(this)" href="Module/NoticeMgr/getmessage.aspx?m=workinfo&id={1}" target="_blank">{2}</a>', record.data.hasread ? "#800080" : "Black", record.data.workInfoID, value);
        }
        var renderDocTopic = function (value, p, record) {
            return String.format('<a onclick="changeColor(this)" href="Module/DocumentMgr/Documentdownload.aspx?m=document&id={0}" target="_blank">{1}</a>', record.data.fileID, value);
        }
        var rendermsgTopic = function (value, p, record) {
            return String.format('<a style="color:{0}" onclick="changeColor(this)" href="Module/NoticeMgr/getmessage.aspx?m=msg&id={1}" target="_blank">{2}</a>', record.data.hasread ? "#800080" : "Black", record.data.msgID, value);
        }

        function changeColor(obj) {
            obj.style.color = "#800080";
        }
        function popupUri(uri, width, height) {
            resetContent();
            mywindow.setWidth(width);
            mywindow.setHeight(height);
            mywindow.center();
            mywindow.show();
            mywindow.load(uri);
        }
        function updatecount(response, result) {
            var text = response;
            var responseArray = Ext.util.JSON.decode(result.responseText);
            document.getElementById('online').firstChild.textContent = "在线人数:" + responseArray.count;
        }
    </script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <div class="container" id="container">
        <div id="header">
            <div id="profile_info">
                <img src="img/avatar.jpg" id="avatar" alt="avatar" onclick="window.location.href='Panel.aspx'"
                    style="cursor: pointer" />
                <p>
                    欢迎<a style="margin-left: 4px; margin-right: 10px" href="Panel.aspx"><%=user.UserName%></a><a
                        style="margin-right: 2px" href="Panel.aspx">设置</a></p>
                <p id="online" style="margin-top: 2px">
                    在线人数:0 <a style="margin-left: 5px;" href="javascript:void(0)" onclick="popupUri('Module/SecurityMgr/passwordchange.aspx',300,200)">
                        修改密码</a><a style="margin-left: 5px;" href="javascript:void(0)" onclick="window.location.href='Logout.aspx'">注销</a>
                </p>
                <p class="last_login" id="lastlogintime" runat="server">
                </p>
            </div>
            <div id="logo">
                <h1>
                    <a href="/"></a>
                </h1>
            </div>
        </div>
        <!-- end header -->
        <div id="content">
            <div id="top_menu" class="clearfix">
                <ul class="sf-menu">
                    <!-- DROPDOWN MENU -->
                    <%if (user.LoginUserType == InformationSystem.BLL.Core.Model.UserType.Assistant)
                      {%>
                    <li>
                        <div style="cursor: pointer;" onclick="javascript:window.location.href='Panel.aspx?m=student'">
                            <a>学生管理</a></div>
                    </li>
                    <%} %>
                    <li>
                        <div style="cursor: pointer;" onclick="javascript:window.location.href='Panel.aspx?m=information'">
                            <a>消息管理</a></div>
                    </li>
                    <li>
                        <div style="cursor: pointer;" onclick="javascript:window.location.href='Panel.aspx?m=document'">
                            <a>文档资料</a></div>
                    </li>
                    <li>
                        <div style="cursor: pointer;" onclick="javascript:window.open('Forum/ForumList.aspx?forumid=1')">
                            <a>论坛</a></div>
                    </li>
                    <li>
                        <div style="cursor: pointer;" onclick="javascript:window.location.href='Panel.aspx?m=mail'">
                            <a>站内信<%=unreadmailcount%></a></div>
                    </li>
                </ul>
                <div style="cursor: pointer;" onclick="popupUri('About.aspx',300,200)">
                    <a id="visit" class="right">关于/About</a></div>
            </div>
            <div id="panels" class="clearfix">
                <div class="panel photo left">
                    <ext:Panel runat="server" Layout="FitLayout" Header="true" Title="公告" Height="300">
                        <Tools>
                            <ext:Tool Qtip="更多" Type="Plus" Handler="javascript:window.location.href='Panel.aspx?m=affiche'">
                            </ext:Tool>
                        </Tools>
                        <Items>
                            <ext:GridPanel ID="AfficheGrid" runat="server" StripeRows="true" Header="false" Border="false"
                                AutoExpandColumn="aName" AutoScroll="true">
                                <LoadMask ShowMask="false" />
                                <Store>
                                    <ext:Store ID="AfficheStore" runat="server" RemoteSort="true">
                                        <Reader>
                                            <ext:JsonReader IDProperty="AfficheID">
                                                <Fields>
                                                    <ext:RecordField Name="afficheID" Mapping="AfficheID" Type="Int" />
                                                    <ext:RecordField Name="title" Mapping="Title" Type="String" />
                                                    <ext:RecordField Name="hasread" Mapping="HasRead" Type="Boolean" />
                                                    <ext:RecordField Name="commitUserName" Mapping="CommitUserName" Type="String" />
                                                    <ext:RecordField Name="sendTime" Mapping="SendTime" Type="Date" />
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:Store>
                                </Store>
                                <SelectionModel>
                                    <ext:RowSelectionModel ID="SelectedRowModel1" runat="server" SingleSelect="true" />
                                </SelectionModel>
                                <ColumnModel ID="ColumnModel1" runat="server">
                                    <Columns>
                                        <ext:Column Header="aID" DataIndex="afficheID" Hidden="true" />
                                        <ext:Column ColumnID="aName" Header="公告" Sortable="true" DataIndex="title">
                                            <Renderer Fn="renderAfficheTopic" />
                                        </ext:Column>
                                        <ext:Column Header="发布者" Width="50" Sortable="true" DataIndex="commitUserName" />
                                        <ext:DateColumn ColumnID="asendtime" Header="发布时间" Width="80" Sortable="true" DataIndex="sendTime"
                                            Format="yyyy-MM-dd" />
                                    </Columns>
                                </ColumnModel>
                            </ext:GridPanel>
                        </Items>
                    </ext:Panel>
                </div>
                <!-- end #photo -->
                <div class="panel todo right">
                    <ext:Panel ID="Panel1" runat="server" Layout="FitLayout" Header="true" Title="就业信息"
                        Height="300">
                        <Tools>
                            <ext:Tool Qtip="更多" Type="Plus" Handler="javascript:window.location.href='Panel.aspx?m=workinfo'">
                            </ext:Tool>
                        </Tools>
                        <Items>
                            <ext:GridPanel ID="WorkGrid" runat="server" StripeRows="true" Header="false" Border="false"
                                AutoExpandColumn="wName">
                                <LoadMask ShowMask="false" />
                                <Store>
                                    <ext:Store ID="WorkStore" runat="server" RemoteSort="true">
                                        <Reader>
                                            <ext:JsonReader IDProperty="WorkInfoID">
                                                <Fields>
                                                    <ext:RecordField Name="workInfoID" Mapping="WorkInfoID" Type="Int" />
                                                    <ext:RecordField Name="title" Mapping="Title" Type="String" />
                                                    <ext:RecordField Name="hasread" Mapping="HasRead" Type="Boolean" />
                                                    <ext:RecordField Name="commitUserName" Mapping="CommitUserName" Type="String" />
                                                    <ext:RecordField Name="sendTime" Mapping="SendTime" Type="Date" />
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:Store>
                                </Store>
                                <SelectionModel>
                                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
                                </SelectionModel>
                                <ColumnModel ID="ColumnModel2" runat="server">
                                    <Columns>
                                        <ext:Column Header="wID" DataIndex="workInfoID" Hidden="true" />
                                        <ext:Column ColumnID="wName" Header="就业信息" Sortable="true" DataIndex="title">
                                            <Renderer Fn="renderWorkInfoTopic" />
                                        </ext:Column>
                                        <ext:Column Header="发布者" Width="50" Sortable="true" DataIndex="commitUserName" />
                                        <ext:DateColumn ColumnID="wsendtime" Header="发布时间" Width="80" Sortable="true" DataIndex="sendTime"
                                            Format="yyyy-MM-dd" />
                                    </Columns>
                                </ColumnModel>
                            </ext:GridPanel>
                        </Items>
                    </ext:Panel>
                </div>
                <!-- end #todo -->
                <div class="panel photo left">
                    <ext:Panel ID="Panel2" runat="server" Layout="FitLayout" Header="true" Title="消息"
                        Height="300">
                        <Tools>
                            <ext:Tool Qtip="更多" Type="Plus" Handler="javascript:window.location.href='Panel.aspx?m=information'">
                            </ext:Tool>
                        </Tools>
                        <Items>
                            <ext:GridPanel ID="MsgGrid" runat="server" StripeRows="true" Header="false" Border="false"
                                AutoExpandColumn="mName">
                                <LoadMask ShowMask="false" />
                                <Store>
                                    <ext:Store ID="MsgStore" runat="server" RemoteSort="true">
                                        <Reader>
                                            <ext:JsonReader IDProperty="WorkInfoID">
                                                <Fields>
                                                    <ext:RecordField Name="msgID" Mapping="MsgID" Type="Int" />
                                                    <ext:RecordField Name="subject" Mapping="Subject" Type="String" />
                                                    <ext:RecordField Name="hasread" Mapping="HasRead" Type="Boolean" />
                                                    <ext:RecordField Name="sendUserName" Mapping="SendUserName" Type="String" />
                                                    <ext:RecordField Name="sendTime" Mapping="SendTime" Type="Date" />
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:Store>
                                </Store>
                                <SelectionModel>
                                    <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" SingleSelect="true" />
                                </SelectionModel>
                                <ColumnModel ID="ColumnModel3" runat="server">
                                    <Columns>
                                        <ext:Column Header="mID" DataIndex="msgID" Hidden="true" />
                                        <ext:Column ColumnID="mName" Header="信息" Sortable="true" DataIndex="subject">
                                            <Renderer Fn="rendermsgTopic" />
                                        </ext:Column>
                                        <ext:Column Header="发送者" Width="50" Sortable="true" DataIndex="sendUserName" />
                                        <ext:DateColumn ColumnID="msendtime" Header="发送时间" Width="80" Sortable="true" DataIndex="sendTime"
                                            Format="yyyy-MM-dd" />
                                    </Columns>
                                </ColumnModel>
                            </ext:GridPanel>
                        </Items>
                    </ext:Panel>
                </div>
                <!-- end #photo -->
                <div class="panel todo right">
                    <ext:Panel ID="Panel3" runat="server" Layout="FitLayout" Header="true" Title="共享文档"
                        Height="300">
                        <Tools>
                            <ext:Tool Qtip="更多" Type="Plus" Handler="javascript:window.location.href='Panel.aspx?m=document'">
                            </ext:Tool>
                        </Tools>
                        <Items>
                            <ext:GridPanel ID="DocGrid" runat="server" StripeRows="true" Header="false" Border="false"
                                AutoExpandColumn="dName">
                                <LoadMask ShowMask="false" />
                                <SelectionModel>
                                    <ext:RowSelectionModel ID="RowSelectionModel3" runat="server" SingleSelect="true" />
                                </SelectionModel>
                                <Store>
                                    <ext:Store ID="DocStore" runat="server" RemoteSort="true">
                                        <Reader>
                                            <ext:JsonReader IDProperty="FileID">
                                                <Fields>
                                                    <ext:RecordField Name="fileID" Mapping="FileID" Type="Int" />
                                                    <ext:RecordField Name="uploadFileName" Mapping="UploadFileName" Type="String" />
                                                    <ext:RecordField Name="createUserName" Mapping="CreateUserName" Type="String" />
                                                    <ext:RecordField Name="createTime" Mapping="CreateTime" Type="Date" />
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:Store>
                                </Store>
                                <ColumnModel ID="ColumnModel4" runat="server">
                                    <Columns>
                                        <ext:Column Header="fID" Width="40" Sortable="true" Hidden="true" DataIndex="fileID" />
                                        <ext:Column ColumnID="dName" Header="文档名称" Sortable="true" DataIndex="uploadFileName">
                                            <Renderer Fn="renderDocTopic" />
                                        </ext:Column>
                                        <ext:Column Header="发布者" Width="50" Sortable="true" DataIndex="createUserName" />
                                        <ext:DateColumn ColumnID="dcreatetime" Header="发布时间" Width="80" Sortable="true" DataIndex="createTime"
                                            Format="yyyy-MM-dd" />
                                    </Columns>
                                </ColumnModel>
                            </ext:GridPanel>
                        </Items>
                    </ext:Panel>
                </div>
            </div>
            <!-- end #content -->
            <div id="footer" class="clearfix">
                <p class="left">
                    Power by 3161140 672598722</p>
                <p class="right">
                    © 2012 NJUST, Some Rights Reserved.</p>
            </div>
            <!-- end #footer -->
        </div>
        <!-- end container -->
    </div>
    <ext:Window runat="server" ID="mywindow" Width="400" Height="300" Hidden="true" Layout="FitLayout"
        Modal="true">
        <AutoLoad Mode="IFrame" ShowMask="true" MaskMsg="正在加载页面，请稍后...">
        </AutoLoad>
    </ext:Window>
    <ext:TaskManager runat="server" ID="taskmgr">
        <Tasks>
            <ext:Task TaskID="getusercountprogress" AutoRun="true">
                <DirectEvents>
                    <Update Url="UserOnline.aspx" Complete="updatecount(response,result)" Method="GET"
                        Delay="2000">
                    </Update>
                </DirectEvents>
            </ext:Task>
        </Tasks>
    </ext:TaskManager>
</body>
</html>
